package net.lovesrc.allin.biz.DogDog;

import net.lovesrc.allin.jobs.backup.DogDogRegisterJob;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/dog")
public class DogDogRegisterController {

    @Autowired
    DogDogRegisterJob dogRegisterJob;

    @GetMapping("/register/start")
    public String registerStart(String inviteCode) {

        if (StringUtils.isNotEmpty(inviteCode)) {
            dogRegisterJob.inviteCode = inviteCode;
        }
        dogRegisterJob.flag.set(true);
        return "ok";
    }

}
